import { Rule, RuleType } from '@midwayjs/validate';
import { ApiProperty } from '@midwayjs/swagger';
import { BaseError as R } from '../../../common/base.error';
import { requiredString } from '../../../common/common.validate.rules';
import { OrderManageEntity } from '../entity/orderManage';
import { BaseDTO } from '../../../common/base.dto';

export class OrderManageDTO extends BaseDTO<OrderManageEntity> {
  @ApiProperty({
    description: '房间类型',
  })
  @Rule(requiredString.error(R.validateError('房间类型不能为空')))
  type?: string;

  @ApiProperty({
    description: '预约人',
  })
  @Rule(requiredString.error(R.validateError('预约人不能为空')))
  orderName?: string;

  @ApiProperty({
    description: '预约时间',
  })
  @Rule(requiredString.error(R.validateError('预约时间不能为空')))
  orderDate?: string;

  @ApiProperty({
    description: '预约结束时间',
  })
  @Rule(requiredString.error(R.validateError('预约结束时间不能为空')))
  orderEndDate?: string;

  @ApiProperty({
    description: '计费开始时间',
  })
  @Rule(RuleType.allow(null))
  startChargeDate?: string;

  @ApiProperty({
    description: '计费结束时间',
  })
  @Rule(RuleType.allow(null))
  endChargeDate?: string;

  @ApiProperty({
    description: '剩余时间',
  })
  @Rule(RuleType.allow(null))
  remainingTime?: string;

  @ApiProperty({
    description: '联系电话',
  })
  @Rule(requiredString.error(R.validateError('联系电话不能为空')))
  phone?: string;

  @ApiProperty({
    description: '客户来源',
  })
  @Rule(requiredString.error(R.validateError('客户来源不能为空')))
  source?: string;

  @ApiProperty({
    description: '预约状态',
  })
  @Rule(requiredString.error(R.validateError('预约状态不能为空')))
  status?: string;

  @ApiProperty({
    description: '预约房间名字',
  })
  @Rule(requiredString.error(R.validateError('预约房间名字不能为空')))
  room?: string;

  @ApiProperty({
    description: '预约房间ID',
  })
  @Rule(requiredString.error(R.validateError('预约房间ID不能为空')))
  roomId?: string;

  @ApiProperty({
    description: '关联房间',
  })
  rooms?: any
}